#!/usr/bin/sh

# 通达信日线数据名称改为指定名称

//通达信期权代码表转换
awk -F ',' '{ print "rename -v \"#"$1".\" \"#"$2".\" */[4567]#\""$1".\"*"}' ds_code.csv| bash

for dir in `ls -d */`
do
    cd $dir
    mkdir CFFEX SHFE DCE ZCE INE GFEX
    rename -v L8. MAIN. *
    rename -v L9. INDEX. *
    rename -v 28# ZCE/ *
    rename -v 29# DCE/ *
    rename -v 30# SHFE/ *
    rename -v 47# CFFEX/ *
    rename -v 66# GFEX/ *
    mv SHFE/{SC,LU,NR,BC}* INE  

     # 期权转换
    
    rename -v 4# ZCE/ *
    rename -v 5# DCE/ *
    rename -v 6# SHFE/ *
    rename -v 7# CFFEX/ *  
    rename -v 67# GFEX/ *  
    \rm -f *
    cd ..
done



